<?php

class UserConferenceElementRecord extends TActiveRecord
{
	const TABLE = 'users_conference_elements';
	
	// fields
	public $user_id;
	public $conference_element_id;
	
	public function setUserId($user_id)                              { $this->user_id = $user_id; }
	public function setConferenceElementId($conference_element_id)   { $this->conference_element_id = $conference_element_id; }
	
	public function getUserId()                { return $this->user_id; }
	public function getConferenceElementId()   { return $this->conference_element_id; }
	
	public function setData($user_id, $conference_element_id)
	{
		$this->user_id = $user_id;
		$this->conference_element_id = $conference_element_id;
	}
	
	public function setDataByUserConferenceElementRecord($record)
	{
		if($record instanceof UserConferenceElementRecord)
		{
			$this->setData($record->getUserId(), $record->getConferenceElementId());
		}
	}
	
	public function equals($record)
	{
		if($record instanceof UserConferenceElementRecord)
		{
			return	$this->getUserId() == $record->getUserId()	&&
					$this->getConferenceElementId() == $record->getConferenceElementId();
		}
		return false;
	}
	
	public static function finder($className=__CLASS__)
	{
		return parent::finder($className);
	}
}

?>